﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using Project.View;

namespace Project.Model
{
    public class Pion : PionObservable
    {
        private Vak vak;
        private PionPanel pionPanel;

        private SpelerObserver observer;

        private bool move;
        private bool pionMoetTerug;

        public Pion(Color color)
        {
            this.pionPanel = new PionPanel(this, color);
            this.move = false;
            this.pionMoetTerug = false;
        }

        public void RegisterObserver(SpelerObserver o)
        {
            this.observer = o;
        }

        public void setPionTerug()
        {
            this.pionMoetTerug = true;
            this.observer.Update();
        }

        public void VerplaatsPion()
        {
            this.observer.VerplaatsPion(this);
        }

        // Vak Property
        public Vak Vak
        {
            get { return vak; }
            set { vak = value; }
        }

        // PionPanel Property
        public PionPanel PionPanel
        {
            get { return pionPanel; }
            set { pionPanel = value; }
        }

        // Move Property
        public bool Move
        {
            get { return move; }
            set { move = value; }
        }

        // PionMoetTerug Property
        public bool PionMoetTerug
        {
            get { return pionMoetTerug; }
            set { pionMoetTerug = value; }
        }
    }
}
